﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace XnaExample {
	public class Label : DrawableGameComponent {
		public SpriteBatch SpriteBatch { get; set; }
		public SpriteFont SpriteFont { get; set; }
		public Color Color { get; set; }
		public Vector2 Position { get; set; }
		public string Text { get; set; }

		public Label(Game game, Color color, Vector2 position, string text)
			: base(game) {
			Color = color;
			Position = position;
			Text = text;
		}

		public override void Draw(GameTime gameTime) {
			SpriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState);
			SpriteBatch.DrawString(SpriteFont, Text, Position, Color);
			SpriteBatch.End();
		}
	}
}
